<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>for_in循环</title>
    <style>
        *{margin: 0;padding: 0;list-style-type: none;}
    </style>
</head>
<body>
    <script>
        let obj = {
            img_src: "./images/goods1.png",
                goods_id: 4544,
                goods_price: 100,
                goods_title: "辣椒酱"
        }
        //for  in 循环 for(变量 in 对象) 遍历次数取决于遍历对象的长度
        for(let v in obj){
            //v 表示遍历中，每条键值对的属性名
            console.log(v);
            console.log(obj[v])//打印该属性下所对应的值
        }
    </script>
</body>
</html>